package org.groupg.project.demo;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonProcessor {
    private static final ObjectMapper jsonMapper = JacksonConfigurator.createJsonMapper();

    public static String toJson(Employee employee) throws JsonProcessingException {
        return jsonMapper.writeValueAsString(employee);
    }

    public static Employee fromJson(String json) throws JsonProcessingException {
        return jsonMapper.readValue(json, Employee.class);
    }
}